package org.yiqixue.accounts.dto;

import org.yiqixue.accounts.entity.Transaction;
import lombok.Data;

@Data
public class TransactionDto {
    private Long transactionID;
    private Long accountNumber;
    private Double amount;
    private String transactionDate;
    private String description;
    private String status;
    private String type;

    public TransactionDto(Transaction transaction) {
        this.transactionID = transaction.getTransactionID();
        this.accountNumber = transaction.getAccountNumber();
        this.amount = transaction.getAmount();
        this.transactionDate = transaction.getTransactionDate().toString();
        this.description = transaction.getDescription();
        this.status = transaction.getStatus();
        this.type = transaction.getType();
    }
}